const getLargestNumberOfCharacters = (str) => {
  if (str.length <= 0) {
    return "";
  }

  const charMap = {};

  str = str.toLowerCase();

  let maxChar = "";
  let maxCharNumber = 0;
  for (let char of str) {
    if (/[a-z]/.test(char)) {
      charMap[char] = (charMap[char] || 0) + 1;
      if (charMap[char] >= maxCharNumber) {
        maxChar = char;
        maxCharNumber = charMap[char];
      }
    }
  }

  return maxChar;
};

console.log(getLargestNumberOfCharacters("12a"));
